<?php 
class CartWS_Model_Organization extends Ext_Db_Table
{
	protected $_name = 'or_organization';
	protected $_sequence = 'or_organization_seq';
	public function getActiveAsArray()
	{
		$rowset = $this->fetchAll(
			$this->select()->where( "locked = 'F'" )
		);
		$result = array();		
		foreach( $rowset as $row ) {
			$result[ $row->organization_id ] = $row->name;
		}
		return $result; 
	}
	public function getSelectWithDescr()
	{
		return $this->getAdapter()->select()
			->from( array( 'or1' => 'or_organization' ), 
				array( 'or1.*', 'fend_date' => "to_char( or1.end_date, '". self::DEFAULT_DATE_FORMAT. "')" )
			);
	}
}